package org.devf.fork.imsimulator.socket.packet;

import org.devf.fork.imsimulator.model.MessageContentType;
import org.devf.fork.imsimulator.service.TokenMgr;
import org.devf.fork.imsimulator.socket.dto.BasePackets;
import org.devf.fork.imsimulator.socket.dto.BizType;
import org.devf.fork.imsimulator.socket.dto.MsgContents;
import org.devf.fork.imsimulator.socket.dto.MsgStatus;

/**
 * Packets related
 *
 * @author wanghuafu
 * @since 1.0  2023/9/26 17:34
 */
public class PacketsFactory {

    public static BasePackets getSingleChatPackets(String message,Long friendId){
        BasePackets packets = new BasePackets();
        packets.setAck(false);
        packets.setMsgStatus(MsgStatus.INSTANT.getCode());
        packets.setBizType(BizType.SINGLE_CHAT.name());
        packets.setFromDeviceId(TokenMgr.userModel.getDeviceId());
        packets.setDestDeviceId(friendId+"");
        packets.setContents(new MsgContents(MessageContentType.TEXT.getValue(),
                message));
        return packets;
    }

}
